Conversation
- Add detectFirstCommitYear() function to auto-detect first commit year - Update FormatCopyrightYears() to use auto-detection when copyright_year not set - Graceful fallback to current year if git unavailable - Explicit copyright_year in config always takes precedence - Add comprehensive unit tests for auto-detection - Update README documentation to explain auto-detection behavior This enhancement eliminates the need to manually configure copyright_year for existing repositories, reducing configuration time from ~30min to ~2min per repo for the TF-337 rollout.
86a09c8 to
c6e2416
Compare
- Add fetch-depth: 0 to checkout action in golang-test job - This ensures git log can find the first commit for auto-detection - Revert test to strict validation now that full history is available
Collaborator
There was a problem hiding this comment.
Recommendation:
- I think the better approach would be to fetch the year-1 information from workflow and pass it as parameter into copywrite tool.
- For private and internal repos, it might face authentication issues. GH APP Token and Key will be present in the GH secrets and they can be used to authenticate to any repo across Hashicorp Organisation.
- Workflows will stay in the Copyright-notice-automation repo which is private so key will be not exposed as well.
- For repos where copyright year is different from the first commit year, teams can reach out and we can either hardcode that information in copyright-notice-automation repo or save the year in config(giving it higher priority).
Code is still missing update on files where code changes are made. If a file is updated then the year-2 should be updated only for that file, rather than the entire repo. That functionality needs to be introduced.
- Changed template from 'Copyright (c) YEAR HOLDER' to 'Copyright (c) HOLDER YEAR' - Now produces correct IBM format: 'Copyright (c) IBM Corp. 2023, 2026' - Updated both tmplSPDX and tmplCopyrightOnly templates
mohanmanikanta2299
approved these changes
Jan 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🛠️ Description
🔗 External Links
👍 Definition of Done
🤔 Can be merged upon approval?
✅
PCI review checklist
I have documented a clear reason for, and description of, the change I am making.
If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.
If applicable, I've documented the impact of any changes to security controls.
Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.